/*
    NAME: mspquery.h

    PURPOSE:
        This file contains definitions for queries that can be sent
        to objects defined in mspobj.h.  (For commands see mspcmd.h)
        These queries are sent using the MSPP Service.

  Copyright (c) 2004 NMS Communications Corp.  All rights reserved.
*/

/* Macro used to concatenate commands with filter definitions */

#ifndef MSPQUERY_H
#define MSPQUERY_H

#define         mspBuildQuery(filter,query)     ((filter << 8) | query)


/************************************************************************\
 *                              MSPP Queries                            *
 *                                                                      *
\************************************************************************/

/*
    Each MSPP Object can have 248 commands.  Hence, the range of command code
    for each MSPP object (filter) is between 0x00 - 0xEF.  Command codes
    between 0xF0 - 0xFF are reserved for commands that can be applied to
    all MSPP objects, example: MSP_CMD_ESC.
*/

/* Query applied to all filters */

#define	MSP_QRY_ETHERNET_LINK_STATUS   0x01
#define	MSP_QRY_CPU_USAGE			   0x02
#define MSP_QRY_IPV6_ADDRS             0x03

/*******************************************************************/
/* Fusion DPF Commands/Events                                      */
/* Commands:                                                       */
/*   "SET" commands occupy 0x0000 to 0x000F                        */
/*   "GET" queries occupy 0x0010 to 0x001F                         */
/*   Diagnostic/Debug commands occupy 0x0020 to 0x002F             */
/*                                                                 */
/* All events will echo the Command Message Type, and attach the   */
/* appropriate data if required.  Unknown, or non-implemented      */
/* funtions will echo the command "OR-ed" with                     */
/* FUNCTION_NOT_IMPLEMENTED                                        */
/*******************************************************************/

/*******************************************************************/
/* Encoder queries                                                 */
/*   See MSP Return Buffer area below for the format of buffer     */
/* field returned from an MSP Encoder object as a result of a      */
/* query.                                                          */
/*******************************************************************/
#define MSP_QRY_ENCODE_STATUS                       0x0010
#define MSP_QRY_ENCODE_PING                         0x0011
#define MSP_QRY_ENCODE_TEST_TONE                    0x0020
#define MSP_QRY_ENCODE_DIAGNOSTIC                   0x0021

/*******************************************************************/
/* Decoder queries                                                 */
/*   See MSP Return Buffer area below for the format of buffer     */
/* field returned from an MSP Decoder object as a result of a      */
/* query.                                                          */
/*******************************************************************/
#define MSP_QRY_DECODE_STATUS                       0x0010
#define MSP_QRY_DECODE_PING                         0x0011
#define MSP_QRY_DECODE_TEST_TONE                    0x0020
#define MSP_QRY_DECODE_DIAGNOSTIC                   0x0021

/*******************************************************************/
/* T.38 Fax Modulator/Demodulator DPF filter commands              */
/*******************************************************************/
#define MSP_QRY_FAXRELAY_SESSION_STATUS             0x001C

        /**********************************************************/
        /* NOTE: The FAXRELAY_SESSION_STATUS is returned as a     */
        /*       result of the MSP_QRY_FAXRELAY_SESSION_STATUS    */
        /*       query. This structure is defined in mspunsol.h   */
        /**********************************************************/


/*******************************************************************/
/* Escape query                                                */
/*******************************************************************/
#define MSP_QRY_ESC                                 0x00F0

/*******************************************************************/
/* Error Event Code                                                */
/*******************************************************************/
#define FUNCTION_NOT_IMPLEMENTED                    0x0900



/*******************************************************************/
/* Fusion Filters : Jitter                                         */
/*******************************************************************/
/*********************************/
/*  Endpoint Filters         */
/*********************************/

/* RTP Full Duplex Filter Query  */
#define MSP_QRY_RTPFDX_STATUS                       0x10

// Video Assembly/Packetization Queries
#define MSP_QRY_RTPFDX_VIDEO_MPEG4_ASSY_STATUS      0x11
#define MSP_QRY_RTPFDX_H264_TX_STATUS               0x11
#define MSP_QRY_RTPOUT_H264_TX_STATUS               MSP_QRY_RTPFDX_H264_TX_STATUS

// Media Gateway Full-Duplex Video Packet Size Query
#define MSP_QRY_RTPFDX_VIDEO_RTP_PKTSZ_CTRL         0x12

/* RTP Simplex Receive Filter Query */
#define MSP_QRY_RTPIN_STATUS                        0x10

/* RTP Simplex Send Filter Query */
#define MSP_QRY_RTPOUT_STATUS                       0x10

/* UDP Full Duplex Filter Query  */
#define MSP_QRY_UDPFDX_STATUS                       0x01

/* UDP Simplex Receive Filter Query */
#define MSP_QRY_UDPIN_STATUS                        0x01

/* UDP Simplex Send Filter Query */
#define MSP_QRY_UDPOUT_STATUS                       0x01

/* T38 Full Duplex Filter Query  */
#define MSP_QRY_T38UDP_STATUS                       0x11

/* MUX Endpoint queries			*/
#define	MSP_QRY_GET_CAPABILITY_SETTING				0x10
#define	MSP_QRY_GET_LCN_INFO						0x11
#define	MSP_QRY_GET_SN_MODE							0x12
#define	MSP_QRY_GET_AL_MODE							0x13

/* RTPv6 Full Duplex Filter Query  */
#define MSP_QRY_RTPFDX_V6_STATUS                    0x10
/* RTPv6 Simplex Receive Filter Query */
#define MSP_QRY_RTPIN_V6_STATUS                     0x10
/* RTPv6 Simplex Send Filter Query */
#define MSP_QRY_RTPOUT_V6_STATUS                    0x10
/* UDPv6 Full Duplex Filter Query  */
#define MSP_QRY_UDPFDX_V6_STATUS                    0x02
/* UDPv6 Simplex Receive Filter Query */
#define MSP_QRY_UDPIN_V6_STATUS                     0x02
/* UDPv6 Simplex Send Filter Query */
#define MSP_QRY_UDPOUT_V6_STATUS                    0x02



/*********************************/
/*  Channel Filters          */
/*********************************/

/* Jitter Query */
#define     MSP_QRY_JITTER_GET_STATE                0x10

// Media Gateway Video Jitter State Query
#define		MSP_QRY_JITTER_VIDEO_GET_STATE	        0x10

// Media Gateway G711 Anysize Jitter Query
#define		MSP_QRY_JITTER_G711_ANYSIZE_GET_STATE	0x10

/* RTP Assembler Query */
#define     MSP_QRY_RTPASM_GET_STATE                0x10

/* RTP Disassembler Query */
#define     MSP_QRY_RTPDISASM_GET_STATE             0x10

/* ThroughPacket Query */
#define         MSP_QRY_TPKT_CHANNEL                0x02

/* RTP Switch Query */
#define         MSP_QRY_RTPSWITCH_GET_STATE            0x10
/************************************************************************\
 *                      MSP RETURN DATA BUFFER DEFINITIONS              *
 *                                                                      *
\************************************************************************/
/* These values define the format of data sent down to a MSP object in
   the buffer field of the mspQuery API call (if applicable).
   Naming format for this is: msp_[type]_[objectname]_[description]
   examples: type        = ENDPOINT, FILTER
             objectname  = JITTER, G723ENCODE, RTPASSEMBLER
             description = MSP_QRY_JITTER_GET_STATE

  example:

   ret = mspSendQuery(MSPHD hMsp,
            mspBuildQuery(MSP_FILTER_JITTER,MSP_QRY_JITTER_GET_STATE),
            NULL,
            0);
*/


/************************************************************************\
 *                      MSP RETURN DATA BUFFERS                         *
 *                                                                      *
\************************************************************************/
/* These values define the format of data sent returned from a MSP object
   in the event buffer field from the MSP object (if applicable).
   Naming format for this is: msp_[type]_[objectname]_[description]
   examples: type        = ENDPOINT, FILTER
             objectname  = JITTER, G723ENCODE, RTPASSEMBLER
             description = GETECHOTAPS

  pretend example:
  typedef struct tag_msp_FILTER_G723ENCODE_GETECHOTAPS
  {
    WORD    echotap1;
    WORD    echotap2;
  } msp_FILTER_G723ENCODE_GETECHOTAPS

*/

/*******************************************************************/
/* Fusion Filters Return Data: Encoder/Decoder                     */
/*******************************************************************/

/*********************************/
/*  Endpoint Filters         */
/*********************************/

typedef struct tag_msp_ENDPOINT_RTPFDX_STATUS {
   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   DWORD        localIPAddr;
   DWORD        localPort;
   DWORD        remoteIPAddr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   DWORD        linkEvents;
   // RTP Stats
   DWORD        rxDrop;
   DWORD        rxPkts;
   DWORD        rxBytes;
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;
   // RTP Assem Data
   DWORD        frame_quota;
   DWORD        assemble_dtmfFrames;
   // RTP Disassem Data
   DWORD        last_pid_rcvd;
   DWORD        mismatches;
   DWORD        last_map_vocoder;
   DWORD        last_map_pid;
   DWORD        disassemble_dtmfFrames;
   DWORD        dtmfEvents;

} msp_ENDPOINT_RTPFDX_STATUS;

//Media Gateway Full-Duplex Video Assembly Status Query

typedef struct tag_FRAME_TYPES
{
    U32   numI;       //Number of I frames transmitted
    U32   numP;       //Number of P frames transmitted
    U32   numB;       //Number of B frames transmitted
    U32   numSprite;  //Number of Sprite frames transmitted

} FRAME_TYPES;

typedef struct tag_VIDMP4_RTP_ASSEMBLY_STATUS
{
    DWORD FilterId;
    U32   totInvalidPkts;    // Total number of invalid packets transmitted
    U32   numConsecCfg;      // Number of Config packets sent when next packet
                             // also starts with Config (VOP's should come after CFG)
    U32   numCfgThenVp;      // Number of Config packets sent that are followed
                             // by a VP packet (VOP's should come after CFG)
    U32   numCfgOnly;        // Number of Config packets sent while awaiting a VOP.
                             // Probably had to send because of packet size limit.
    U32   numCfgFragThenCfg; // Number of Config frag packets sent that are followed
                             // by a CFG packet
    U32   numCfgFragThenVop; // Number of Config frag packets sent that are followed
                             // by a VOP packet
    U32   numCfgFragThenVp;  // Number of Config frag packets sent that are followed
                             // by a VP packet
    U32   numCfgFragOnly;    // Number of Config frag-only packets sent
    U32   numInitialFrag;    // Initial packets sent before a PM found
    U32   startPMNotCFGError;// First PM found is not a CFG
    U32   numVOLSearchErrors;// Number of times no VOL found in a pkt with CFG info
    U32   numVOPSearchErrors;// Number of times no VOP found in a pkt that is 
                             // supposed to contain a VOP

    FRAME_TYPES  txFrameTypes;  //Structure of transmit frame type statistics

} msp_VIDMP4_RTP_ASSEMBLY_STATUS;

typedef struct tag_msp_ENDPOINT_RTPFDX_H264_TX_STATUS 
{
    DWORD   FilterId;
    DWORD   numPkts;   //Number of packets transmitted
    DWORD   numNALs;   //Number of NALs detected from 324M
    DWORD   numAUs;    //Number of Access Units transmitted
    DWORD   numIDRAUs; //Number of IDR Access Units transmitted
    DWORD   numSPS;    //Number of SPS NAL's transmitted
    DWORD   numPPS;    //Number of PPS NAL's transmitted
    DWORD   numSEI;    //Number of SEI NAL's transmitted

} msp_ENDPOINT_RTPFDX_H264_TX_STATUS;

typedef struct tag_msp_ENDPOINT_RTPIN_STATUS {

   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   DWORD        localIPAddr;
   DWORD        localPort;
   DWORD        remoteIPAddr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   // RTP Stats
   DWORD        rxDrop;
   DWORD        rxPkts;
   DWORD        rxBytes;
   // RTP Disassem Data
   DWORD        last_pid_rcvd;
   DWORD        mismatches;
   DWORD        last_map_vocoder;
   DWORD        last_map_pid;
   DWORD        disassemble_dtmfFrames;
   DWORD        dtmf_event_control;

} msp_ENDPOINT_RTPIN_STATUS;


typedef struct tag_msp_ENDPOINT_RTPOUT_STATUS {

   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   DWORD        localIPAddr;
   DWORD        localPort;
   DWORD        remoteIPAddr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   DWORD        linkEvents;
   // RTP Stats
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;
   // RTP Assem Data
   DWORD        frame_quota;
   DWORD        assemble_dtmfFrames;

}msp_ENDPOINT_RTPOUT_STATUS;



typedef struct tag_msp_ENDPOINT_UDPFDX_STATUS {

   DWORD	FilterId;
   DWORD   	ipFilterState;
   DWORD   	localIPAddr;
   DWORD   	localPort;
   DWORD   	remoteIPAddr;
   DWORD   	remotePort;
   DWORD   	rxDrop;
   DWORD  	rxPkts;
   DWORD   	rxBytes;
   DWORD   	txDrop;
   DWORD   	txFail;
   DWORD   	txPkts;
   DWORD   	txBytes;

}msp_ENDPOINT_UDPFDX_STATUS;

typedef struct tag_msp_ENDPOINT_UDPIN_STATUS {

   DWORD	FilterId;
   DWORD        ipFilterState;
   DWORD        localIPAddr;
   DWORD        localPort;
   DWORD        rxDrop;
   DWORD        rxPkts;
   DWORD        rxBytes;

}msp_ENDPOINT_UDPIN_STATUS;

typedef struct tag_msp_ENDPOINT_UDPOUT_STATUS {

   DWORD        FilterId;
   DWORD        ipFilterState;
   DWORD        localIPAddr;
   DWORD        localPort;
   DWORD        remoteIPAddr;
   DWORD        remotePort;
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;

}msp_ENDPOINT_UDPOUT_STATUS;

typedef struct tag_msp_ENDPOINT_T38UDP_STATUS {

   //T38 Fdx Data
   DWORD	FilterId;
   DWORD   	ipFilterState;
   DWORD   	localIPAddr;
   DWORD   	localPort;
   DWORD   	remoteIPAddr;
   DWORD   	remotePort;
   //T38 Fdx Stats
   DWORD   	rxDrop;
   DWORD  	rxPkts;
   DWORD   	rxBytes;
   DWORD   	txDrop;
   DWORD   	txFail;
   DWORD   	txPkts;
   DWORD   	txBytes;
   //T38 IFP Encoder Data 
   DWORD   	v21_bytes_per_ifp_packet;
   DWORD   	page_modem_ifp_duration;
   DWORD   	t30_indicator_send_count;
   DWORD   	t30_indicator_send_period;
   //T38 UDPTL Encoder Data
   DWORD   	error_protection_scheme;
   DWORD   	redundant_ifp_packets;
   DWORD   	ifp_pkts_per_fec_message;
   DWORD   	fec_messages_per_udptl_pkt;
   DWORD   	num_duplicate_indicator_udptl_packets;
   DWORD   	num_duplicate_v21_udptl_packets;
   DWORD   	num_duplicate_page_modem_udptl_packets;
   //T38 IFP Decoder Data
   DWORD	queue_size;
   DWORD   	buffering_time;
   DWORD	page_data_keep_alive_time;
   //T38 UDPTL Decoder Data
   DWORD   	enable_error_recovery;
   
}msp_ENDPOINT_T38UDP_STATUS;

/*********************************/
/*  MUX Endpoint Queries         */
/*********************************/
typedef struct tag_msp_ENDPOINT_MUX_GET_CAPABILITY_SETTING_QRY
{
    DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	AnnexFlag;		// MUX annex flag
	WORD	Mode;
} msp_ENDPOINT_MUX_GET_CAPABILITY_SETTING_QRY;

typedef struct tag_msp_ENDPOINT_MUX_GET_LCN_INFO_QRY
{
    DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	LogChanNo;		// Logical Channer Number
	WORD	VideoALMode;	// AL mode (AL2/AL3) for Video
	WORD	DataKind;		// Audio/Video/Control
//	WORD	AL_SDU_Unit[MAX_DATA_SIZE]; // For Audio only
	WORD	SNMode;			// For Audio only: SN On/Off
//	WORD    Direction;		// -->/<--/bidirectional
	WORD	MaxSDUSize;		// H.245 Max SDU size
	WORD 	NoOfFrames;		// # of frames (1,2,3) per SDU
} msp_ENDPOINT_MUX_GET_LCN_INFO_QRY;

// For debugging purposes
typedef struct tag_msp_ENDPOINT_MUX_GET_SN_MODE_QRY
{
    DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	SNMode;			// Sequence # On/Off for Audio
} msp_ENDPOINT_MUX_GET_SN_MODE_QRY;

// For internal use only
typedef struct tag_msp_ENDPOINT_MUX_GET_AL_MODE_QRY
{
    DWORD	FilterId;
	WORD	CmdId;  //Success Flag in upper byte, CmdId in lower byte
	WORD	VideoALMode;	// equivalent to ALClassification in LCN_INFO
} msp_ENDPOINT_MUX_GET_AL_MODE_QRY;

/*******  Endpoint Filters - IPv6 ******/

typedef struct tag_msp_ENDPOINT_RTPFDX_V6_STATUS {
   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   IPV6Addr     localIPv6Addr;
   DWORD        localPort;
   IPV6Addr     remoteIPv6Addr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   DWORD        linkEvents;
   DWORD        trafficClass;
   DWORD        flowLabel;
   DWORD        linkNum;
   // RTP Stats
   DWORD        rxDrop;
   DWORD        rxPkts;
   DWORD        rxBytes;
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;
   // RTP Assem Data
   DWORD        frame_quota;
   DWORD        assemble_dtmfFrames;
   // RTP Disassem Data
   DWORD        last_pid_rcvd;
   DWORD        mismatches;
   DWORD        last_map_vocoder;
   DWORD        last_map_pid;
   DWORD        disassemble_dtmfFrames;
   DWORD        dtmfEvents;

} msp_ENDPOINT_RTPFDX_V6_STATUS;


typedef struct tag_msp_ENDPOINT_RTPIN_V6_STATUS {

   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   IPV6Addr     localIPv6Addr;
   DWORD        localPort;
   IPV6Addr     remoteIPv6Addr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   // RTP Stats
   DWORD        rxDrop;
   DWORD        rxPkts;
   DWORD        rxBytes;
   // RTP Disassem Data
   DWORD        last_pid_rcvd;
   DWORD        mismatches;
   DWORD        last_map_vocoder;
   DWORD        last_map_pid;
   DWORD        disassemble_dtmfFrames;
   DWORD        dtmf_event_control;

} msp_ENDPOINT_RTPIN_V6_STATUS;


typedef struct tag_msp_ENDPOINT_RTPOUT_V6_STATUS {

   // RTP Data
   DWORD     	FilterId;
   DWORD        ipFilterState;
   IPV6Addr     localIPv6Addr;
   DWORD        localPort;
   IPV6Addr     remoteIPv6Addr;
   DWORD        remotePort;
   DWORD        rtcpEvents;
   DWORD        linkEvents;
   DWORD        trafficClass;
   DWORD        flowLabel;
   DWORD        linkNum;
   // RTP Stats
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;
   // RTP Assem Data
   DWORD        frame_quota;
   DWORD        assemble_dtmfFrames;

}msp_ENDPOINT_RTPOUT_V6_STATUS;



typedef struct tag_msp_ENDPOINT_UDPFDX_V6_STATUS {

   DWORD	FilterId;
   DWORD   	ipFilterState;
   IPV6Addr localIPv6Addr;
   DWORD    localPort;
   IPV6Addr remoteIPv6Addr;
   DWORD   	remotePort;
   DWORD   	rxDrop;
   DWORD  	rxPkts;
   DWORD   	rxBytes;
   DWORD   	txDrop;
   DWORD   	txFail;
   DWORD   	txPkts;
   DWORD   	txBytes;

}msp_ENDPOINT_UDPFDX_V6_STATUS;

typedef struct tag_msp_ENDPOINT_UDPIN_V6_STATUS {

   DWORD	 FilterId;
   DWORD     ipFilterState;
   IPV6Addr  localIPv6Addr;
   DWORD     localPort;
   DWORD     rxDrop;
   DWORD     rxPkts;
   DWORD     rxBytes;

}msp_ENDPOINT_UDPIN_V6_STATUS;

typedef struct tag_msp_ENDPOINT_UDPOUT_V6_STATUS {

   DWORD        FilterId;
   DWORD        ipFilterState;
   IPV6Addr     localIPv6Addr;
   DWORD        localPort;
   IPV6Addr     remoteIPv6Addr;
   DWORD        remotePort;
   DWORD        txDrop;
   DWORD        txFail;
   DWORD        txPkts;
   DWORD        txBytes;

}msp_ENDPOINT_UDPOUT_V6_STATUS;


/*********************************/
/*  Channel Filters              */
/*********************************/

typedef struct tag_msp_FILTER_ENCODE_STATE
{
   DWORD  FilterId;
   WORD   CommandEcho;
   WORD   State;
   WORD   Gain;
   WORD   VadControl;
   WORD   Rate;
   WORD   PayloadID;
   WORD   IPFormat;
   WORD   NotchControl;
   WORD   DtmfMode;
   WORD   DSPId;
   WORD   ActiveCnt;
   WORD   SIDCnt;
   WORD   NullCnt;
   WORD   DtmfCnt;
   WORD   DSOutQFullCnt;
} msp_FILTER_ENCODE_STATE;

typedef struct tag_msp_FILTER_DECODE_STATE
{
   DWORD  FilterId;
   WORD   CommandEcho;
   WORD   State;
   WORD   Gain;
   WORD   Rate;
   WORD   PayloadID;
   WORD   IPFormat;
   WORD   DtmfMode;
   WORD   DSPId;
   WORD   ActiveCnt;
   WORD   SIDCnt;
   WORD   NullCnt;
   WORD   DtmfCnt;
   WORD   InvalidPktCnt;
   WORD   DSInQEmptyCnt;
   WORD   DSInQExtraCnt;
} msp_FILTER_DECODE_STATE;

/* If field does not apply for specific Encoder/Decder, filter */
/* returns DOES_NOT_APPLY.                                     */
#define DOES_NOT_APPLY 0xDEAD




/*******************************************************************/
/* Fusion Filters Return Data: Jitter                              */
/*******************************************************************/
typedef struct tag_msp_FILTER_JITTER_STATE {
    DWORD   filter_id;
    DWORD   rx;
    DWORD   rx_accept;
    DWORD   tx;
    DWORD   tx_valid;
    DWORD   requested_depth;
    DWORD   actual_depth;
    DWORD   remote_frame_duration;
    DWORD   underflows;
    DWORD   overflows;
    DWORD   lost_pkts;
    DWORD   duplicate_frames;
    DWORD   reordered_frames;
    DWORD   rejected_frames;
    DWORD   dtmf_frames;
    DWORD   combined_frames;
    DWORD   adapt_enabled;
    DWORD   discarded_frames;
    DWORD   average_depth;
} msp_FILTER_JITTER_STATE;

// Media Gateway Video Jitter state query
typedef struct tag_msp_FILTER_JITTER_VIDEO_STATE {
    DWORD   FilterId;
    DWORD   pktsReceived;
    DWORD   pktsAccepted;
    DWORD   pktsRejected;
    DWORD   pktsLost;
    DWORD   pktsCurrent;
    DWORD   overflows;
    DWORD   underflows;
    DWORD   duplicates;
    DWORD   lates;
    DWORD   reorders;
    DWORD   maxBuffers;
    DWORD   jitterBufDelay;
    DWORD   configuredLatency;
    DWORD   h264AggPkts;
    DWORD   h264FragPkts;
    DWORD   pktsDiscarded;

} msp_FILTER_JITTER_VIDEO_STATE;

// Map the legacy MPEG4 structure symbols to the current generic symbols.
#define msp_FILTER_JITTER_VIDEO_MPEG4_STATE msp_FILTER_JITTER_VIDEO_STATE
#define tag_msp_FILTER_JITTER_VIDEO_MPEG4_STATE tag_msp_FILTER_JITTER_VIDEO_STATE

//Media Gateway G711 Anysize Jitter state query
typedef struct tag_msp_FILTER_JITTER_G711_ANYSIZE_STATE
{
    DWORD FilterId;
    U32   pktsReceived;
    U32   pktsAccepted;
    U32   pktsRejected;
    U32   pktsLost;
    U32   pktsCurrent;
    U32   overflows;
    U32   underflows;
    U32   duplicates;
    U32   lates;
    U32   reorders;
    U32   maxBuffers;
    U32   depth;
    U32   rfd;

} msp_FILTER_JITTER_G711_ANYSIZE_STATE;

typedef struct tag_msp_FILTER_RTPDISASM_STATE {
    DWORD   filter_id;
    DWORD   rx;
    DWORD   rx_accept;
    DWORD   tx;
    DWORD   tx_valid;
    DWORD   last_pid_rcvd;
    DWORD   mismatches;
    DWORD   last_map_vocoder;
    DWORD   last_map_pid;
    DWORD   dtmf_frames;
    DWORD   dtmf_event_ctrl;
} msp_FILTER_RTPDISASM_STATE;

typedef struct tag_msp_FILTER_RTPASM_STATE {
    DWORD   filter_id;
    DWORD   rx;
    DWORD   rx_accept;
    DWORD   tx;
    DWORD   tx_valid;
    DWORD   frame_quota;
    DWORD   dtmf_frames;
} msp_FILTER_RTPASM_STATE;

/*******************************************************************/
/* Query for CPU Utilization                                       */
/*******************************************************************/
#define  MAX_CG_CPU  2

typedef struct {
   DWORD       currentUtil;
   DWORD       averageUtil;
} CPU_UTIL;

typedef struct {
   DWORD       numCPUs;
   CPU_UTIL    cpu[MAX_CG_CPU];
} msp_CPU_UTIL;

#define  MAX_CG_ETH  2

/*******************************************************************/
/* Query for Ethernet Status                                       */
/*******************************************************************/
typedef struct {
   DWORD       ethStatus;
#define  ETH_LINK_DOWN  0
#define  ETH_LINK_UP    1
   DWORD       ethMode;
#define  ETH_HALFDUPLEX 0
#define  ETH_FULLDUPLEX 1
   DWORD       ethSpeed;
#define  ETH_10MB       0
#define  ETH_100MB      1
#define  ETH_1000MB     2
} ETH_STATUS;

typedef struct {
   DWORD       numETHs;
   ETH_STATUS  eth[MAX_CG_ETH];
} msp_ETH_STATUS;


typedef struct {
	unsigned ipv6addr[4];   /* IPv6 address */
	int      prefix_len;    /* IPv6 prefix length */
	short    intnum;        /* Network interface number 1/2, 0 - all */
	short    addr_type;     /* 1 - manually created, 2 - autoconfig */
} IPV6ADDRINFO;


/*******************************************************************/
/* Query for ThroughPacket                                         */
/*******************************************************************/

typedef struct {
   DWORD   rxPkts;
   DWORD   txPkts;
} msp_TPKT_CHANNEL_STATS;

#define  MAX_TPKT_CHANNELS 256

typedef struct {
   DWORD   channelState;           // State of the Channel
   DWORD   localSessionID;         // Local Session ID used
   DWORD   remoteSessionID;        // Remote Session ID used
   DWORD   localSessionSeq;        // 0|1 Sequence number for detecting session overlap
   DWORD   remoteSessionSeq;       // 0|1 Sequence number for detecting session overlap
   DWORD   deliveryMethod;         // Session delivery method Simple/Complex
   BYTE    remoteGatewayIP[4];     // Destination Gateway for this session
   DWORD   coderType;              // Vocoder Type
   DWORD   secondsActive;          // Number of Seconds in ACTIVE state

} msp_TPKT_CHANNEL_ENTRY;

typedef struct tag_msp_TPKT_CHANNEL_QUERY {

   DWORD FilterId;
   msp_TPKT_CHANNEL_ENTRY   config;
   msp_TPKT_CHANNEL_STATS   stats;

} msp_TPKT_CHANNEL_QUERY;

/*******************************************************************/
/* Query for RTP Switch filter                                     */
/*******************************************************************/
typedef struct tag_msp_FILTER_RTPSWITCH_STATE{
   DWORD         FilterId;
   DWORD         ipFilterState;
   DWORD         rxDrop;
   DWORD         rxPkts;
   DWORD         rxBytes;
   DWORD         txDrop;
   DWORD         txFail;
   DWORD         txPkts;
   DWORD         txBytes;
}msp_FILTER_RTPSWITCH_STATE;

#endif /* MSPQUERY_H */


